#ifndef _COMMON_H_
#define _COMMON_H_


//#define DEBUG 

#ifdef DEBUG
#include <stdio.h>
#define dprint printf
#else
#define dprint(...)
#endif

#define MAX_COMMAND_LENGTH 1024

//scan a bash command from stdin
void get_command(char * buffer);


void * my_malloc(size_t siz);
void my_free(void *mem);

//split string into tokens, using chars form character_set as separators
void split(char * string, char * character_set, char * * tokens);

char * copy_token(char * string, char * character_set);
void purge(char * *);
void my_assert_malloc_ok();

#endif
